package com.example.tigering.config;

import com.example.tigering.filter.TestingFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Filter;

/**
 * @Author: xwg
 * @CreateDate: 2023/8/23
 */

@Configuration
public class ComponentConfig {
    @Autowired
    private TestingFilter testingFilter;

    @Bean
    public FilterRegistrationBean<TestingFilter> filterFilterRegistrationBean(){
        FilterRegistrationBean<TestingFilter> bean = new FilterRegistrationBean<>();
        bean.setFilter(testingFilter);
        bean.setOrder(100);
        return bean;
    }

}
